<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
      xmlns:layout="http://www.ultraq.net.nz/web/thymeleaf/layout"
      layout:decorator="admin/public/layout">

<head>
    <title>防灌水设置</title>
</head>
<div  layout:fragment="content">
    <section class="content-header">
        <h1>
            防灌水设置
            <small>全站防灌水策略设置</small>
        </h1>
    </section>
    <section class="content">
        <div class="row">
            <div class="col-xs-12">
                <div class="callout callout-warning" th:if="${error}">
                    <h4>数据保存失败！</h4>
                    <ol>
                        <li  th:text="${error.message}"></li>
                    </ol>
                </div>
                <form th:object="${settingIrrigation}" role="form" name="addForm" method="POST" th:action="@{/admin/setting/irrigation}">
                    <input type="hidden" name="id" th:value="${GlobalSetting.irrigation.id}"/>
                    <div class="box box-default">
                        <div class="box-header with-border">
                            <h3 class="box-title">审核策略</h3>
                        </div>
                        <div class="box-body">
                            <div class="form-group">
                                <label >开启问题审核</label>
                                <span class="text-muted">(开启后，用户发起的问题需要在问题管理中审核才能正常显示)</span>
                                <div class="radio">
                                    <label><input type="radio" name="verifyQuestion" value="true" th:checked="${settingIrrigation.verifyQuestion}" > 开启 </label>
                                    <label class="ml-20"><input type="radio" name="verifyQuestion" value="false" th:checked="${!settingIrrigation.verifyQuestion}" > 关闭 </label>
                                </div>
                            </div>
                            <div class="form-group">
                                <label >开启回答审核</label>
                                <span class="text-muted">(开启后，用户的回答需要在回答管理中审核才能正常显示)</span>
                                <div class="radio">
                                    <label><input type="radio" name="verifyAnswer" value="true" th:checked="${settingIrrigation.verifyAnswer}" > 开启 </label>
                                    <label class="ml-20"><input type="radio" name="verifyAnswer" value="false" th:checked="${!settingIrrigation.verifyAnswer}" > 关闭 </label>
                                </div>
                            </div>
                            <div class="form-group">
                                <label >开启文章审核</label>
                                <span class="text-muted">(开启后，用户撰写的文章需要在文章管理中审核才能正常显示)</span>
                                <div class="radio">
                                    <label><input type="radio" name="verifyArticle" value="true" th:checked="${settingIrrigation.verifyArticle}" > 开启 </label>
                                    <label class="ml-20"><input type="radio" name="verifyArticle" value="false" th:checked="${!settingIrrigation.verifyArticle}" > 关闭 </label>
                                </div>
                            </div>
                            <div class="form-group">
                                <label >开启评论审核</label>
                                <span class="text-muted">(开启后，用户的评论需要在评论管理中审核才能正常显示)</span>
                                <div class="radio">
                                    <label><input type="radio" name="verifyComment" value="true" th:checked="${settingIrrigation.verifyComment}" > 开启 </label>
                                    <label class="ml-20"><input type="radio" name="verifyComment" value="false" th:checked="${!settingIrrigation.verifyComment}"> 关闭 </label>
                                </div>
                            </div>
                        </div>
                    </div>

                    <div class="box box-default">
                        <div class="box-header with-border">
                            <h3 class="box-title">验证码策略</h3>
                        </div>
                        <div class="box-body">
                            <div class="form-group">
                                <label >启用验证码</label>
                                <span class="text-muted">(验证码可以避免恶意注册及恶意灌水，请选择需要打开验证码的操作)</span>
                                <div class="checkbox">
                                    <input type="checkbox" name="codeLogin" th:value="${settingIrrigation.codeLogin}"  th:checked="${settingIrrigation.codeLogin}" /> 登录
                                    <label><input type="checkbox" name="codeRegister" th:value="${settingIrrigation.codeRegister}" th:checked="${settingIrrigation.codeRegister}" /> 注册</label>
                                    <label><input type="checkbox" name="codeCreateQuestion" th:value="${settingIrrigation.codeCreateQuestion}" th:checked="${settingIrrigation.codeCreateQuestion}" /> 发起提问</label>
                                    <label><input type="checkbox" name="codeCreateAnswer" th:value="${settingIrrigation.codeCreateAnswer}" th:checked="${settingIrrigation.codeCreateAnswer}" /> 回答问题</label>
                                    <label><input type="checkbox" name="codeCreateArticle" th:value="${settingIrrigation.codeCreateArticle}" th:checked="${settingIrrigation.codeCreateArticle}" /> 发布文章</label>
                                </div>
                            </div>
                        </div>
                    </div>

                    <div class="box box-default">
                        <div class="box-header with-border">
                            <h3 class="box-title">内容写入限制策略</h3>
                        </div>
                        <div class="box-body">
                            <div class="form-group">
                                <label >1小时内最大提问数</label>
                                <span class="text-muted">(设置为0则不做任何限制)</span>
                                <input type="text" class="form-control" name="questionLimitNumPerHour" placeholder="0为不限制" th:value="${settingIrrigation.questionLimitNumPerHour}"  />
                            </div>
                            <div class="form-group">
                                <label >1小时内最大回答数</label>
                                <span class="text-muted">(设置为0则不做任何限制)</span>
                                <input type="text" class="form-control" name="answerLimitNumPerHour" placeholder="0为不限制" th:value="${settingIrrigation.answerLimitNumPerHour}"  />
                            </div>
                            <div class="form-group">
                                <label >1小时内最大文章发表次数</label>
                                <span class="text-muted">(设置为0则不做任何限制)</span>
                                <input type="text" class="form-control" name="articleLimitNumPerHour" placeholder="0为不限制" th:value="${settingIrrigation.articleLimitNumPerHour}"  />
                            </div>
                            <hr />
                            <div class="form-group">
                                <label >提问后编辑内容时效</label>
                                <span class="text-muted">(默认单位是分钟，设置后用户只能在编辑时间有效期内进行修改，设置为0则不做任何限制)</span>
                                <input type="text" class="form-control" name="editQuestionTimeout" placeholder="0为不限制" th:value="${settingIrrigation.editQuestionTimeout}" />
                            </div>
                            <div class="form-group">
                                <label >发起文章后编辑内容时效</label>
                                <span class="text-muted">(默认单位是分钟，设置后用户只能在编辑时间有效期内进行修改，设置为0则不做任何限制)</span>
                                <input type="text" class="form-control" name="editArticleTimeout" placeholder="0为不限制" th:value="${settingIrrigation.editArticleTimeout}"  />
                            </div>
                            <div class="form-group">
                                <label >撰写回答后编辑内容时效</label>
                                <span class="text-muted">(默认单位是分钟，设置后用户只能在编辑时间有效期内进行修改，设置为0则不做任何限制)</span>
                                <input type="text" class="form-control" name="editAnswerTimeout" placeholder="0为不限制" th:value="${settingIrrigation.editAnswerTimeout}"  />
                            </div>

                        </div>
                    </div>
                    <div>
                        <button type="submit" class="btn btn-primary" >保存</button>
                        <button type="reset" class="btn btn-success">重置</button>
                    </div>
                </form>
            </div>
        </div>

    </section>
</div>